<?php

namespace TableTennis\UsefulInformationBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

class DefaultController extends Controller
{
    public function indexAction()
    {
        return $this->render('TableTennisUsefulInformationBundle:Default:index.html.twig', array());
    }

    public function homeAction()
    {
        $useful_info_list = $this->getDoctrine()
                          ->getRepository('TableTennisUsefulInformationBundle:UsefulInformation')
                          ->findAllOrderedByUpdatedAt(5);

        return $this->render('TableTennisUsefulInformationBundle:Default:home.html.twig', array( 'useful_info_list' => $useful_info_list ));
    }
}
